package com.atguigu.gulimall.product.entity;

import com.atguigu.common.valid.AddGroup;
import com.atguigu.common.valid.ListValue;
import com.atguigu.common.valid.UpdateGroup;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import org.hibernate.validator.constraints.URL;

import javax.validation.constraints.*;

/**
 * Ʒ��
 * 
 * @author weiZhiLong
 * @email 1807149205@qq.com
 * @date 2023-01-03 19:45:25
 */
@Data
@TableName("pms_brand")
public class BrandEntity implements Serializable {
	private static final long serialVersionUID = 1L;


	@NotNull(message = "修改必须指定品牌id" , groups = {UpdateGroup.class})
	@Null(message = "新增不能指定id" , groups = {AddGroup.class})
	@TableId
	private Long brandId;

	@NotBlank(message = "品牌名不能为空" , groups = {AddGroup.class, UpdateGroup.class})
	private String name;

	@NotEmpty(groups = AddGroup.class)
	@URL(message = "URL不合法", groups = {AddGroup.class, UpdateGroup.class})
	private String logo;

	@NotEmpty(message = "描述不能为空", groups = {AddGroup.class, UpdateGroup.class})
	private String descript;

	@ListValue(vals = {0,1})
	@NotEmpty(message = "显示状态不能为空")
	private Integer showStatus;

	@NotEmpty(message = "首字母检索不能为空")
	@Pattern(regexp = "/^[a-zA-Z]$]/" , message = "检索首字母必须是一个字母")
	private String firstLetter;

	@NotNull(message = "排序不能为空")
	@Min(value = 0, message = "排序必须大于等于0")
	private Integer sort;

}
